﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MsTestUtilities.SolutionAnalysis;

namespace MsTestUtilitiesTests.SolutionAnalysisTests.SolutionTests.HeaderParsing
{
    [TestClass]
    public class HeaderParsingTests : SolutionParsingFixture
    {
        private const string Header = @"Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
";
        protected override string SolutionFileText
        {
	        get { return Header; }
        }
        
        [TestMethod]
        public void ParseFileFormatVersion()
        {            
            Assert.AreEqual("12.00", SolutionFile.FileFormat);
        }

        [TestMethod]
        public void Author()
        {
            Assert.AreEqual("Visual Studio Express 2013 for Windows Desktop", SolutionFile.Author);
        }

        [TestMethod]
        public void VisualStudioVersion()
        {
            Assert.AreEqual(new Version("12.0.21005.1"), SolutionFile.VisualStudioVersion);
        }

        [TestMethod]
        public void MinimumVisualStudioVersion()
        {
            Assert.AreEqual(new Version("10.0.40219.1"), SolutionFile.MinimumVisualStudioVersion);
        }
    }
}
